//
//  CustomTextField.m
//  拉勾7.17
//
//  Created by dllo on 16/7/17.
//  Copyright © 2016年 YMJ. All rights reserved.
//

#import "CustomTextField.h"

@implementation CustomTextField
//控制显示文本的位置
- (CGRect)textRectForBounds:(CGRect)bounds {
    return CGRectMake(bounds.origin.x + 75, bounds.origin.y, bounds.size.width - 70, bounds.size.height);
}
//控制编辑文本的位置
- (CGRect)editingRectForBounds:(CGRect)bounds {
   return CGRectMake(bounds.origin.x + 75, bounds.origin.y, bounds.size.width - 75, bounds.size.height);
}
// 以上两个配合通常一起使用,记住一旦自定全部都要重写bounds指的是当前textField的位置坐标
//控制placeHolder的颜色、字体
- (void)drawPlaceholderInRect:(CGRect)rect {
    [[UIColor whiteColor] setFill];
    [self.placeholder drawInRect:CGRectMake(rect.origin.x, rect.size.height / 4, rect.size.width, rect.size.height) withAttributes:@{NSForegroundColorAttributeName:[UIColor lightGrayColor],NSFontAttributeName:[UIFont italicSystemFontOfSize:19]}];// 浅gay色
}
//控制左视图位置
- (CGRect)leftViewRectForBounds:(CGRect)bounds {
    return CGRectMake(bounds.origin.x, bounds.origin.y, 53, 53);
}
@end
